#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <vector>

using namespace std;

int wiggleMaxLength(vector<int>& nums) {
    int n = nums.size();
    vector<int> f(n + 10, 1);
    vector<int> g(n + 10, 1);
    int ret = INT_MIN;

    for (int i = 1; i <= n; ++i)
    {
        for (int j = i - 1; j >= 1; --j)
        {
            if (nums[i - 1] > nums[j - 1])
                f[i] = max(g[j] + 1, f[i]);
            if (nums[i - 1] < nums[j - 1])
                g[i] = max(f[j] + 1, g[i]);
        }
        ret = max(ret, max(g[i], f[i]));
    }


    return ret;
}

int main()
{

	return 0;
}